$primaryColor: #0086d4;


.omg-gantt {
  display: flex;
  flex-direction: row;
  overflow: hidden;
  --border-color: #e0e0e0;
  --row-height: 40px;
  border: 1px solid var(--border-color)
}

@mixin scrollbar {
  &::-webkit-scrollbar {
    width: 0px;
    height: 1px;
  }
  &::-webkit-scrollbar-thumb {
    border-radius: 10px;
    // box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
    background: rgba(0,0,0,.5);
  }
  &::-webkit-scrollbar-track {/*滚动条里面轨道*/
    // box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 10px;
    background: #eee;
  }
}

@mixin tableBase {
  width: 100%;
  // border-collapse: collapse;
  border-collapse: separate;
  
  border-spacing: 0;
  border: none;
  overflow: hidden;
  table-layout: fixed;
}


.omg-grid {
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;

  * {
    box-sizing: border-box;
  }
  

  &__inner {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    height: 100%;
    overflow-y: hidden;
  }
  &__header {  // table
    @include tableBase;
    height: 80px;
    background: #f9f9f9;
    color: #888;
    border-bottom: 1px solid #ccc;
    font-weight: bold;
    
    .omg-grid__row:last-child {
      border-bottom: none;
    }
    .omg-grid__row {
      --row-height: 80px;

    }
    .omg-grid__cell {
      position: relative;
      text-align: center;
      border-bottom: none;
      & > .cell {
        padding: 0;
      }
    }
  }
  &__row {
    &:last-child {
      .omg-grid__cell {
        border-bottom: none;
      }
    }
  }
  &__cell {
    width: 100px;
    height: var(--row-height);
    box-sizing: border-box;
    border-bottom: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
    text-overflow: ellipsis;
    text-align: left;
    &:first-child {
      border-left: none;
    }

    &:last-child {
      // border-right: none;
      // border-right: 1px solid var(--border-color);
    }
    & > .cell {
      position: relative;
      padding: 0 8px;
      height: 100%;
      width: 100%;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: stretch;
      overflow: hidden;
      white-space: nowrap
    }

  }
  &__cell--has-timebar {
    z-index: 1;
  }
  &__header-wrapper {
    overflow-x: hidden;
    width: 100%;
  }
  &__body-wrapper {
    overflow-x: hidden;
    width: 100%;
    height: calc(100% - 80px);
    margin-top: -1px;
    overflow-y: auto;
    @include scrollbar;
  }

  &__body { // table
    @include tableBase;
    width: 100%;
  }
  
}

.omg-grid-timegrid {
  border-left: 2px solid var(--border-color);
  flex:1;
  height: 100%;
  .omg-grid__cell {
    position: relative;
  }
  .omg-grid__timebar {
    position: absolute;
    box-sizing: border-box;
    padding: 0 8px;
    left: 0;
    top: 0;
    bottom: 0;
    font-size: 12px;
    background: rgba($primaryColor, 0.923);
    border-radius: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
  }
}


.omg-pop-tips {
  position: absolute;

  width: 260px;
  height: 160px;
  z-index: 1000;
  background: #fff;
  box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  &__arrow {
    box-sizing: border-box;
    width: 20px;
    height: 20px;
    background: #fff;
    border: 1px solid var(--border-color);
    position: absolute;
    left: 50%;
    transform: translateX(-50%) rotate(-45deg);
    clip-path: polygon(0 0, 100% 0, 100% 100%);
    top: -10px;
    z-index: 1;
  }
}

.omg-markline {
  --color: $primaryColor;
  --line-style: solid;
  --line-width: 1px;
  position: absolute;
  z-index: 10;
  color: #fff;

  &__label {
    position: absolute;
    background-color: var(--color);
    padding: 2px 4px;
    border-radius: 2px;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
  }
}

.omg-markline--vertical {
  position: absolute;
  z-index: 10;
  top: 0;
  height: 100%;
  border-left: var(--line-width) var(--line-style) var(--color);
}